<?php if (!defined('BASEPATH')) {exit('No direct script access allowed');}
	function arraydate($type=""){
		switch($type){
			case 'tanggal':
				$data = array(
					'0' => array('code'=>'01','value'=>'1'),
					'1' => array('code'=>'02','value'=>'2'),
					'2' => array('code'=>'03','value'=>'3'),
					'3' => array('code'=>'04','value'=>'4'),
					'4' => array('code'=>'05','value'=>'5'),
					'5' => array('code'=>'06','value'=>'6'),
					'6' => array('code'=>'07','value'=>'7'),
					'7' => array('code'=>'08','value'=>'8'),
					'8' => array('code'=>'09','value'=>'9'),
					'9' => array('code'=>'10','value'=>'10'),
					'10' => array('code'=>'11','value'=>'11'),
					'11' => array('code'=>'12','value'=>'12'),
					'12' => array('code'=>'13','value'=>'13'),
					'13' => array('code'=>'14','value'=>'14'),
					'14' => array('code'=>'15','value'=>'15'),
					'15' => array('code'=>'16','value'=>'16'),
					'16' => array('code'=>'17','value'=>'17'),
					'17' => array('code'=>'18','value'=>'18'),
					'18' => array('code'=>'19','value'=>'19'),
					'19' => array('code'=>'20','value'=>'20'),
					'20' => array('code'=>'21','value'=>'21'),
					'21' => array('code'=>'22','value'=>'22'),
					'22' => array('code'=>'23','value'=>'23'),
					'23' => array('code'=>'24','value'=>'24'),
					'24' => array('code'=>'25','value'=>'25'),
					'25' => array('code'=>'26','value'=>'26'),
					'26' => array('code'=>'27','value'=>'27'),
					'27' => array('code'=>'28','value'=>'28'),
					'28' => array('code'=>'29','value'=>'29'),
					'29' => array('code'=>'30','value'=>'30'),
					'30' => array('code'=>'31','value'=>'31'),
				);
				
				/*
				$data = array();
				$tgl = 1;
				$no = 0;
				while($tgl <= 31){
					array_push($data, array('code' => $tgl, 'value'=>$tgl));
					$tgl++;
				}
				*/
			break;
			case 'bulan':
				$data = array(
					'0' => array('code'=>'01','value'=>'Januari'),
					'1' => array('code'=>'02','value'=>'Februari'),
					'2' => array('code'=>'03','value'=>'Maret'),
					'3' => array('code'=>'04','value'=>'April'),
					'4' => array('code'=>'05','value'=>'Mei'),
					'5' => array('code'=>'06','value'=>'Juni'),
					'6' => array('code'=>'07','value'=>'Juli'),
					'7' => array('code'=>'08','value'=>'Agustus'),
					'8' => array('code'=>'09','value'=>'September'),
					'9' => array('code'=>'10','value'=>'Oktober'),
					'10' => array('code'=>'11','value'=>'November'),
					'11' => array('code'=>'12','value'=>'Desember'),
				);
			break;
			case 'tahun':
				$data = array();
				$year = 1960;
				$no = 0;
				while($year <= 2020){
					array_push($data, array('code' => $year, 'value'=>$year));
					$year++;
				}
			break;
		}
		
		return $data;
	}
	
	function randcode() {
		$uid = uniqid(date("YmdHis"), true);
		return $uid;
	}
